package org.elephas.model;

import javax.persistence.Entity;
import javax.persistence.OneToOne;

/**
 * Represents the configuration for an individual blog with Elephas.
 *
 * <p> User: Nick Heudecker </p> <p> Date: Jan 28, 2008 </p> <p> Time: 5:57:16 PM </p>
 */
@Entity
public class BlogConfiguration extends AbstractPersistent {
    private Boolean allowComments = Boolean.TRUE;
    private Boolean allowPingbacks = Boolean.TRUE;
    private Boolean allowTrackbacks = Boolean.TRUE;
    private Integer postsOnFrontPage = 5;
    private String theme = "default";
    
    @OneToOne(optional = false, mappedBy = "configuration")
    private Blog blog;

    public BlogConfiguration() {
    }

    public BlogConfiguration(Blog blog) {
        this.blog = blog;
    }

    public Boolean getAllowComments() {
        return allowComments;
    }

    public void setAllowComments(Boolean allowComments) {
        this.allowComments = allowComments;
    }

    public Boolean getAllowPingbacks() {
        return allowPingbacks;
    }

    public void setAllowPingbacks(Boolean allowPingbacks) {
        this.allowPingbacks = allowPingbacks;
    }

    public Boolean getAllowTrackbacks() {
        return allowTrackbacks;
    }

    public void setAllowTrackbacks(Boolean allowTrackbacks) {
        this.allowTrackbacks = allowTrackbacks;
    }

    public Blog getBlog() {
        return blog;
    }

    public void setBlog(Blog blog) {
        this.blog = blog;
    }

    public Integer getPostsOnFrontPage() {
        return postsOnFrontPage;
    }

    public void setPostsOnFrontPage(Integer postsOnFrontPage) {
        this.postsOnFrontPage = postsOnFrontPage;
    }

    public String getTheme() {
        return theme;
    }

    public void setTheme(String theme) {
        this.theme = theme;
    }
}
